package com.ad.controller;

import com.ad.service.AdService;
import com.api.entity.PromotionAd;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author wang
 * @create 2021-08-31 15:24
 */
@RestController
@RequestMapping("ad")
@CrossOrigin
public class AdController {

    @Autowired
    private AdService adService;

    @GetMapping("getAdsBySpaceId/{spaceid}")
    public List<PromotionAd> getAdsBySpaceId(@PathVariable("spaceid") Integer sid){
        List<PromotionAd> list = adService.getAdsBySpaceId(sid);
        return list;
    }
}
